﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TemperatureChart;

namespace TestForm
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            String sql = "select ID 编号, NAME 姓名, AGE 年龄, SEX 性别, DEPARTMENT 科别, ";
            sql += "INPATIENTAREA 病区,BEDNO 床号, HOSPITALIZATIONNUMBER 住院号, ";
            sql += "RYRQ 入院日期, SSRQ 手术日期 from dbo.TC_BRXX";
            DataTable dtBrxx = SqlHelper.ExecuteDataSet(CommandType.Text,sql).Tables[0];
            this.dataGridView1.DataSource = dtBrxx;
            //TemperatureUC tuc = new TemperatureUC();
            //tuc.Tc.MainTitle = "测试XXX医院";
            //tuc.Tc.SecondTitle = "测试体温单";
            //tuc.Tc.TimeStart = 4;
            //tuc.Dock = DockStyle.Fill;
            //this.Controls.Add(tuc);
        }

        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                int id = (int)this.dataGridView1.Rows[e.RowIndex].Cells[0].Value;
                TC_TEST tt = new TC_TEST();
                tt.Brid = id;
                tt.ShowDialog();
            }
        }

        private void 录入数据ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRow dgvr = this.dataGridView1.SelectedRows[0];
            int brid =Convert.ToInt32(dgvr.Cells["编号"].Value.ToString());
            TC_DATALR tc_da = new TC_DATALR();
            tc_da.Brid = brid;
            tc_da.ShowDialog();
        }

        private void 病案首页ToolStripMenuItem_Click(object sender, EventArgs e)
        {
           

        }

    }
}
